<!DOCTYPE html>
<html lang="en">
<head>
{% block head %}
<title>{% block title %}{% endblock %} - Google+ Playground</title>
<meta name="description" content="Google+ demos running on Google App Engine (GAE)">
<meta name="author" content="Rowan Merewood">
<!-- Bootstrap core CSS -->
<link href="/css/bootstrap.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="/css/jumbotron-narrow.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
      <script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
      <script src="https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js"></script>
<![endif]-->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="/icons/favicon.ico">
<link rel="apple-touch-icon" sizes="57x57" href="/icons/apple-touch-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/icons/apple-touch-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/icons/apple-touch-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/icons/apple-touch-icon-144x144.png" />
<link rel="apple-touch-icon" sizes="60x60" href="/icons/apple-touch-icon-60x60.png" />
<link rel="apple-touch-icon" sizes="120x120" href="/icons/apple-touch-icon-120x120.png" />
<link rel="apple-touch-icon" sizes="76x76" href="/icons/apple-touch-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="152x152" href="/icons/apple-touch-icon-152x152.png" />
<link rel="icon" type="image/png" href="/icons/favicon-196x196.png" sizes="196x196" />
<link rel="icon" type="image/png" href="/icons/favicon-160x160.png" sizes="160x160" />
<link rel="icon" type="image/png" href="/icons/favicon-96x96.png" sizes="96x96" />
<link rel="icon" type="image/png" href="/icons/favicon-32x32.png" sizes="32x32" />
<link rel="icon" type="image/png" href="/icons/favicon-16x16.png" sizes="16x16" />
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="msapplication-TileImage" content="/icons/mstile-144x144.png" />
<meta name="msapplication-square70x70logo" content="/icons/mstile-70x70.png" />
<meta name="msapplication-square144x144logo" content="/icons/mstile-144x144.png" />
<meta name="msapplication-square150x150logo" content="/icons/mstile-150x150.png" />
<meta name="msapplication-square310x310logo" content="/icons/mstile-310x310.png" />
<meta name="msapplication-wide310x150logo" content="/icons/mstile-310x150.png" />
<meta name="google-signin-clientid" content="{{ clientId }}" />
<meta name="google-signin-scope" content="https://www.googleapis.com/auth/plus.login" />
<meta name="google-signin-cookiepolicy" content="single_host_origin" />
<meta name="google-signin-callback" content="signInCallback" />
<meta name="local-nonce" content="{{ nonce }}" />
{% endblock %}
</head>
<body>
    <div class="container">
        <div class="header">
            <ul class="nav nav-pills pull-right">
                <li><a href="/signin">Here</a></li>
                <li><span id="signinButton" class="signinButton"><span class="g-signin" data-accesstype="offline" data-theme="light"></span></span></li>
            </ul>
            <h3 class="text-muted">Google+ Playground</h3>
        </div>
        {% block content %}
        <div class="jumbotron">
            <h1>Jumbotron heading</h1>
            <p class="lead">Cras justo odio, dapibus ac facilisis in, egestas eget quam. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum
                nibh, ut fermentum massa justo sit amet risus.</p>
            <p>
                <a class="btn btn-lg btn-success" href="#" role="button">Sign up today</a>
            </p>
        </div>
        <div class="row marketing">
            <div class="col-lg-6">
                <h4>Subheading</h4>
                <p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.</p>
                <h4>Subheading</h4>
                <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.</p>
                <h4>Subheading</h4>
                <p>Maecenas sed diam eget risus varius blandit sit amet non magna.</p>
            </div>
            <div class="col-lg-6">
                <h4>Subheading</h4>
                <p>Donec id elit non mi porta gravida at eget metus. Maecenas faucibus mollis interdum.</p>
                <h4>Subheading</h4>
                <p>Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Cras mattis consectetur purus sit amet fermentum.</p>
                <h4>Subheading</h4>
                <p>Maecenas sed diam eget risus varius blandit sit amet non magna.</p>
            </div>
        </div>
        {% endblock %}
        <div class="footer">
            <p>Google+ demos running on Google App Engine (GAE)</p>
        </div>
    </div>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="/js/base.js"></script>
    <script type="text/javascript">
        (function() {
          var po = document.createElement('script');
          po.type = 'text/javascript'; po.async = true; po.src = 'https://apis.google.com/js/client:plusone.js?onload=plusonePostLoad';
          var s = document.getElementsByTagName('script')[0];
          s.parentNode.insertBefore(po, s);
        })();

        function plusonePostLoad() {
          $('.signoutButton').click(function() {
            gapi.auth.signOut();
          });

          $('.disconnectButton').click(function() {
            var token = gapi.auth.getToken();
            var revokeUrl = 'https://accounts.google.com/o/oauth2/revoke?token=' + token.access_token;

            // Perform an asynchronous GET request.
            $.ajax({
              type: 'GET',
              url: revokeUrl,
              async: false,
              contentType: "application/json",
              dataType: 'jsonp',
              success: function(nullResponse) {
                // Do something now that user is disconnected
              },
              error: function(e) {
                console.log(e);
              }
            });
          });
          {% block plusonepostload %}{% endblock %}
        }

        function disconnectUser(access_token) {

        }
        // Could trigger the disconnect on a button click
        $('#revokeButton').click(disconnectUser);
    </script>
</body>
</html>
